/*--------------------------------------------------------------------------
  Project::MONDIALI SCI ALPINISMO
  Package::Gui
  Class::Gui
  File Gui.h
  --------------------------------------------------------------------------
  * METHODS AND CLASS PARAMETERS


  --------------------------------------------------------------------------
  * FUNCTIONS DESCRIPTION
  
	...

  --------------------------------------------------------------------------
  * COPYRIGHT

  --------------------------------------------------------------------------
  * INFO ABOUT AUTHOR AND VERSIONS
  Author:	Tino Giorgio	Data: 
  Rev1:			Data:

  --------------------------------------------------------------------------
  * E-MAIL & CONTACTS

  GIORGIO TINO:	tinoshi@libero.it
	           	shapeofangels@hotmail.com
	            giorgio.tino@studenti.polito.it

  --------------------------------------------------------------------------*/

#if !defined(GUI_H)
#define GUI_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/* PLIB Includes */
#include <plib/ul.h>
#include <plib/pu.h>

/* Application Includes*/
#include "Defines.h"
#include "LoadingInfo.h"

#define NUM_MAIN_BUTTONS 4

#define GUI_TEXT_LENGTH 1024

#define GUI_CAMERA_COORD_COLOR 1.0f,0.0f,0.0f,0.7f
#define GUI_POINTER_COORD_COLOR 1.0f,1.0f,0.0f,0.7f

#define NUM_PLAYER_BUTTONS    4
#define PLAYER_BUTTON_WIDTH  20
#define PLAYER_BUTTON_HEIGTH 20
#define PLAYER_START_Y       25

#define INFO_GO_TO_CAMERA_REPOSITIONING "     Press 'c' to reposition selected camera     \0"
#define INFO_RETURN_TO_EDITING          "       Press 'c' to return to editing mode       \0"
#define INFO_STOP_PLAYING_MOVIE		    "Press 'q' to return to editing mode and end movie\0"

class State;
class ScenarioCreationState;
class Menu;
class SubMenu;

class GUI  
{
public:
	GUI(State* s, LoadingInfo* li);
	virtual ~GUI();

	//
	// Static callbacks (PUI menu)
	//
	static void exit_cb ( puObject * );
	static void back_cb ( puObject * ); 
	static void save_cb ( puObject * );
	static void createb_cb ( puObject * );
	static void togglew_cb ( puObject * );
	static void trym_cb ( puObject * );
	static void playm_cb ( puObject * );
	static void stopm_cb ( puObject * );
	static void ffwdm_cb ( puObject * );
	static void rewm_cb ( puObject * );
	
	void show();
	int  mouse(int button, int state, int x, int y);
	void display();
	void bindTextures();
	int getAction();
	int getType();
	int getKind();
	
	void switchToEditingView();
	void switchToCameraRepositioningView();
	void switchToMovieView();

	void setCorrection(float x, float y);
	void setData(sgCoord* camera, float hot, float* pointer);

private:
	puMenuBar *menu;

	Menu *m;

	int bs;  
	int type; // button selected
	int kind; // subbutton selected 

	int bb,tt,ll,ww,mm,ff; // building types number of buttons

	float x_correction;
	float y_correction;

	puGroup     *infoGroup,*player;

	puArrowButton *playButton;
	puArrowButton *stopButton;
	puArrowButton *forwardButton;
	puArrowButton *rewindButton;

	puText		*camera_east;
	char		camera_east_text_legend[GUI_TEXT_LENGTH];

	puText		*camera_north;
	char		camera_north_text_legend[GUI_TEXT_LENGTH];

	puText		*camera_h;
	char		camera_h_text_legend[GUI_TEXT_LENGTH];

	puText		*camera_p;
	char		camera_p_text_legend[GUI_TEXT_LENGTH];

	puText		*camera_r;
	char		camera_r_text_legend[GUI_TEXT_LENGTH];

	puText		*camera_hot;
	char		camera_hot_text_legend[GUI_TEXT_LENGTH];

	puText		*camera_heigth;
	char		camera_heigth_text_legend[GUI_TEXT_LENGTH];

	puText		*pointer_east;
	char		pointer_east_text_legend[GUI_TEXT_LENGTH];

	puText		*pointer_north;
	char		pointer_north_text_legend[GUI_TEXT_LENGTH];

	puText		*pointer_hot;
	char		pointer_hot_text_legend[GUI_TEXT_LENGTH];

	puText		*info;
	char		info_text_legend[GUI_TEXT_LENGTH];
};

#endif // !defined(GUI_H_)
